<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

	<script type="text/javascript">  
		function goInsert(){ 
			$("#form").attr("action","/tracker/trackerDetail.do");
			$("#form").submit();   
		}   
		
		function goDetail(trackerNo){
			$("#trackerNo").val(trackerNo);
			$("#form").attr("action","/tracker/trackerDetail.do");
			$("#form").submit();   
		}  
		
		function goList(pageNum){
			alert(pageNum);  
			$("#pageNum").val(pageNum);
			$("#form").attr("action","/tracker/trackerList.do");
			$("#form").submit();    
		}
</script>
<form class="form-horizontal" role="form" name="form" id="form" method="post">
<input name="trackerNo" id="trackerNo" type="hidden">
<input name="pageNum" id="pageNum" type="hidden" value="${pageNum }">
	<h2 class="sub-header">${title}</h2> 	
          <div class="table-responsive">
            <table class="table table-striped">
              <thead>
                <tr>
	  				<th>No.</th> 
					<th>트래커 코드</th>
					<th>트래커</th>  
					<th>담당자</th>
					<th>시작일</th>
					<th>종료일</th>
                </tr>
              </thead>
              <tbody>
					<c:forEach items="${trackerList}" var="trackerList" varStatus="status">
						<tr>
						    <td>${trackerList.trackerNo }</td>
							<td>${trackerList.trackerCd }</td>
							<td><a href="#" onClick="goDetail('${trackerList.trackerNo}')">${trackerList.title}</a></td>
							<td>${trackerList.handler }</td>
							<td>${trackerList.startDt }</td>
							<td>${trackerList.endDt }</td>     
						</tr>
					</c:forEach>
              </tbody>
            </table>
            <c:if test="${totCnt != 0}">
            	<ul class="pagination">
            		${page}
            	</ul>
			</c:if> 
          </div>

		  <div class="form-group">
		    <div class="col-sm-offset-2 col-sm-10">
		     	<a class="btn btn-default" href="#" onClick="goInsert()">등록</a>
		    </div>
		  </div>
</form>